@model ZKEACMS.Product.Models.ProductEntity
@{ 
    Script.Reqiured("validate").AtFoot();
    Script.Reqiured("tinymce").AtFoot();
}

<div class="panel panel-default">
    <div class="panel-heading">
        @L("新建")
    </div>
    <div class="panel-body">
        @using (Html.BeginForm())
        {
            @Html.EditorForModel()
            <div class="toolBar">
                @if (Authorizer.Authorize(ZKEACMS.Product.PermissionKeys.ManageProduct))
                {
                    <input type="submit" class="btn btn-primary" value="@L("保存")" data-value="@ActionType.Create" />
                }
                @if (Authorizer.Authorize(ZKEACMS.Product.PermissionKeys.PublishProduct))
                {
                    <input type="submit" class="btn btn-info publish" value="@L("发布")" data-value="@ActionType.Publish" />
                }                
                <input type="button" class="btn btn-default cancel" value="@L("取消")" />
            </div>
        }
    </div>
</div>
<table>
    <tr>
        <td align="center"></td>
    </tr>
</table>
@using (Script.AtFoot())
{
    <script type="text/javascript">
        $(function () {
            $("#ProductCategoryID").change(reloadTag);
            function reloadTag() {
                $.post("@Url.Action("ProduceTags")", { productId: $("#ID").val(), ProductCategoryId: $("#ProductCategoryID").val() }, function (data) {
                    $(".tag-selector").parent().html(data);
                }, "html");
            }
            $(document).on("click", ".reload-tag", reloadTag);
            reloadTag();
        });
    </script>
}